package com.buercorp.wangyu.oop.polymorphismdem;

public class Text {
    public static void main(String[] args) {
        Teacher teacher = new Teacher();
        teacher.setName("xiaoli");
        teacher.setAge(28);

        Student student = new Student();
        student.setName("xiao");
        student.setAge(18);

        Administrator administrator = new Administrator();
        administrator.setName("li");
        administrator.setAge(37);

        register(teacher); // 老师的信息为xiaoli28
        register(student); // 学生的信息为xiao18
        register(administrator); // 管理员的信息为li37

    }

    // 这个方法既能接受 老师 又能接收 学生 还能接收 管理员
    public static void register(Person p){
        p.show();
    }
}
